package com.hxkj.cst.chengshuitong.base

import com.hxkj.cst.chengshuitong.RatePaymentEnum
import com.hxkj.cst.chengshuitong.RatePaymentObserver
import com.hxkj.cst.chengshuitong.RatePaymentSubject

/**
 * 作者：LuoYang
 * 时间：2017/5/31:16:14
 * 邮箱：18981443691@163.com
 * 说明：
 */
open class RatePaymentFragment : BaseFragment(), RatePaymentSubject {

    var mRatePaymentObserver: RatePaymentObserver? = null

    override fun registerObserver(ratePaymentObserver: RatePaymentObserver) {
        this.mRatePaymentObserver = ratePaymentObserver
    }

    override fun notifyObserver(ratePaymentEnum: RatePaymentEnum) {
        mRatePaymentObserver?.update(ratePaymentEnum)
    }

    override fun onDestroy() {
        super.onDestroy()
        if (mRatePaymentObserver != null)
            mRatePaymentObserver = null
    }

}